/*
Copyright © 2022 NAME HERE <EMAIL ADDRESS>

*/
package cmd

import (
	"mysqlAdmin/lib/downAdmin"
	userAdmin "mysqlAdmin/lib/userAdm"

	"github.com/spf13/cobra"
)

// initCmd represents the init command
var initCmd = &cobra.Command{
	Use:   "init",
	Short: "mysql环境初始化",
	Long:  `mysql环境初始化.`,
	Run: func(cmd *cobra.Command, args []string) {
		// fmt.Println("init called")
		mySQLInit()
	},
}

func init() {
	rootCmd.AddCommand(initCmd)
}

func mySQLInit() {

	// 建立用户
	userAdmin.Add()

	// 下载软件
	downAdmin.Down()

	// 安装
	downAdmin.Install()
}
